#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([src/linked_list.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
: ${CFLAGS=-O3 -DNDEBUG}
AC_PROG_CC

# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset])

AC_CONFIG_FILES([Makefile
                 porting/Makefile
                 src/Makefile
                 test/Makefile
                 test/porting/Makefile])
AM_INIT_AUTOMAKE

# AC_DISABLE_SHARED
AC_PROG_LIBTOOL

AC_ARG_WITH(libtimer_home, AC_HELP_STRING([--with-libtimer-home], [libtimer home]), LIBTIMER_HOME=$withval, LIBTIMER_HOME=)
AC_SUBST(LIBTIMER_HOME)
AM_CONDITIONAL(WITH_LIBTIMER_HOME, [test "${LIBTIMER_HOME}" != ""])

# enable test
AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test], [enable test (no)]), TEST=$enableval, enable=)
if test "${TEST}" = "yes"; then
    AC_CHECK_LIB([c_timer], [timerNew])
    AC_DEFINE(ENABLE_TEST, 1, [Define to 1 if you want to test.])
fi
AM_CONDITIONAL(ENABLE_TEST, [test "${TEST}" = "yes"])

AC_OUTPUT
